import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useLoginStore = defineStore('login', () => {
  //登陆返回的信息
  const loginData = ref({token:''})
  
  function saveLoginData(payload:any) {
    loginData.value = payload;
  }
  function removeLoginData() {
    loginData.value = {token:''};
  }

  return { loginData, saveLoginData, removeLoginData }
},{ 
  persist:true  //开启持久化存储
})
